Cocktail Help Reference
NavigateToAsync(Type,String,Func<Object,Task>) Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > Navigator Class > NavigateToAsync Method : NavigateToAsync(Type,String,Func<Object,Task>) Method



viewModelType
The type to match.
contractName
The name to match.
prepare
An action to initialize the target ViewModel before it is activated.

Glossary Item Box

Asynchronously navigates to a ViewModel instance that matches the specified name and type. The navigation will be cancelled if the current active ViewModel cannot be closed or the target type is not authorized.

Syntax

Visual Basic (Declaration) 
Public Overloads Function NavigateToAsync( _
   ByVal viewModelType As Type, _
   ByVal contractName As String, _
   ByVal prepare As Func(Of Object,Task) _
) As Task
Visual Basic (Usage)Copy Code
Dim instance As Navigator
Dim viewModelType As Type
Dim contractName As String
Dim prepare As Func(Of Object,Task)
Dim value As Task
 
value = instance.NavigateToAsync(viewModelType, contractName, prepare)
C# 
public Task NavigateToAsync( 
   Type viewModelType,
   string contractName,
   Func<object,Task> prepare
)
C++/CLI 
public:
Task^ NavigateToAsync( 
   Type^ viewModelType,
   String^ contractName,
   Func<Object^,Task^>^ prepare
) 

Parameters

viewModelType
The type to match.
contractName
The name to match.
prepare
An action to initialize the target ViewModel before it is activated.

Return Value

A System.Threading.Tasks.Task to await completion.

Remarks

Not available in Windows 8 Store apps.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.